<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #root{
            width: 500px;
            height: 500px;
            background: green;
            padding: 30px;
            border:20px solid red;
            overflow:auto;
        }
        #app{
            width: 700px;
            height:800px;
            background: red;
            border:10px solid blue;
            padding:20px;
        }
    </style>
</head>
<body>
    <div id="root">
        <div id="app"></div>
    </div>
</body>
<script>
    const root = document.querySelector("#root");
    const app = document.querySelector("#app");
    console.log(root.offsetWidth);// 600;
    console.log(root.offsetHeight);// 600;
    console.log(app.offsetWidth);// 740
    console.log(app.offsetHeight);// 840
</script>
</html>